-- MaintenanceM
-- Create by chendh
-- 维护模块

module("MaintenanceM", package.seeall);

-- 所有的阵营配置信息
local maintenanceTipsTable = {};

-- 载入配置表
local _init = false;
local loadCsv = function()
    if _init then return end
    _init = true;

    -- 转换下audio信息表
    local tip_CSV = get_maintenance_tips_CSV();
    for i = 1, #tip_CSV do
        if not maintenanceTipsTable[tip_CSV[i]["status"]] then
            maintenanceTipsTable[tip_CSV[i]["status"]] = {};
        end

        maintenanceTipsTable[tip_CSV[i]["status"]][tip_CSV[i]["paltform"]] = tip_CSV[i];
    end

    tip_CSV = {};
end

-- 模块初始化
function init()
    loadCsv();
end

-- 根据状态获取提示语
function getTips(status)
    if not maintenanceTipsTable[status] then
        return nil;
    elseif not maintenanceTipsTable[status][PUBLISH_PLATFORM] then
        return maintenanceTipsTable[status]["*"];
    else
        return maintenanceTipsTable[status][PUBLISH_PLATFORM];
    end
end